package com.young.springdemo.service.policy;

//电影票充当环境类
public class MoviTicker {
    private double price;
    private Discount discount;

    public double getPrice() {
        if (discount == null) return price;
        return discount.calcute(price);
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setDiscount(Discount discount) {
        this.discount = discount;
    }
}
